package com.itheima.service.impl;

import com.itheima.mapper.NoticeMapper;
import com.itheima.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

/**
 * @author wangjiexin
 */
@Service
public class NoticeServiceImpl implements NoticeService {
    //通知的三个接口
    @Autowired
    NoticeMapper noticeMapper;
    @Override
    public boolean updateLikeStatus(int status) {
        if (StringUtils.isEmpty(status)){
            throw new RuntimeException("传进来的状态不存在");
        }
        return noticeMapper.updateLikeStatus(status);
    }

    @Override
    public boolean updateDiscussStatus(int status) {
        if (StringUtils.isEmpty(status)){
            throw new RuntimeException("传进来的状态不存在");
        }

        return noticeMapper.updateDiscussStatus(status);
    }

    @Override
    public boolean updateNoticeStatus(int status) {
        if (StringUtils.isEmpty(status)){
            throw new RuntimeException("传进来的状态不存在");
        }

        return noticeMapper.updateNoticeStatus(status);
    }
}
